//
// Created by Javery Chiang on 2025/5/4.
//

#ifndef CMAKECXX_PROCESS_H
#define CMAKECXX_PROCESS_H

#include <iostream>
#include <vector>
#include <queue>
#include <algorithm>
#include <iomanip>

using namespace std;

struct Process {
    int pid;
    int arrival;
    int burst;
    int remaining;
    int finish;
    int waiting;
    int turnaround;

    Process(int id, int arr, int bur) : pid(id), arrival(arr), burst(bur), remaining(bur), finish(0), waiting(0),
                                        turnaround(0) {
    }
};

// 计算拼接等待时间及平均周转时间
void calculateMetrics(const vector<Process> &process);


void FCFS(vector<Process> process);

void RR(vector<Process> process);

void SRTF(vector<Process> process);

#endif //CMAKECXX_PROCESS_H
